<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset='utf-8'>
    <title> - 若维俱乐部 </title>
    <meta name='keywords' content=''>
    <meta name='description' content=''>
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/header.css">
    <link rel="stylesheet" href="css/footer.css">
    <link rel="stylesheet" href="css/updateTeacherInfo.css">
    <link href="css/bootstrap.css" rel="stylesheet"/>
</head>
<body>

<!--头部开始-->
<div id="header" class="clearfix">
    <div class="logo fl">
        <img src="images/header_logo.jpg" alt="">
    </div>
    <ul class="title clearfix fl">
        <li class="hover"><a href="">首页</a></li>
        <li><a href="">博客</a></li>
        <li><a href="">招聘</a></li>
        <li><a href="">新闻</a></li>
        <li><a href="">优秀案例</a></li>
        <li><a href="">学员展示</a></li>
        <li><a href="">在线课程</a></li>
    </ul>
    <button>登录/注册</button>
</div>
<!--头部结束-->

<div class="banner">
    <img src="images/个人.png" alt="">
</div>
<!--banner结束-->

<!--头像开始-->
<div class="portrait">
    <div class="head">
        <img src="images/test.jpg" alt="">
    </div>
    <p class="name">教师一</p>
    <p class="sex">男</p>
</div>
<!--头像结束-->

<!--主体部分开始-->
<div class="content clearfix">
    <div class="left fl">
        <ul>
            <li class="active clearfix">个人信息<span> > </span></li>
            <li class="clearfix">我的博客<span> > </span></li>
            <li class="clearfix">我的课程<span> > </span></li>
            <li class="clearfix">消息中心<span> > </span></li>
        </ul>
    </div>
    <div class="right fl">
        <div class="title clearfix"><span>编辑个人信息</span></div>
        <div class="info">
            <div class="form-group">
                <label>选择头像</label>
                <input class="form-control" type = "file" style="width:400px;" id = "headFile">
            </div>
            <div class="form-group">
                <label>昵称</label>
                <input class="form-control" placeholder="昵称" required style="width:400px;" id = "teachnicheng">
            </div>
            <div class="form-group">
                <label>手机号</label>
                <input class="form-control" type="number" placeholder="昵称" required style="width:400px;" id ="teachPhone">
            </div>
            <div class="form-group">
                <label>教学方向</label>
                <input class="form-control" placeholder="昵称" required style="width:400px;" id="teachDirection">
            </div>
            <div style="text-align:center"><button type = "button" onclick = "updateInfo()">确认修改</button></div>
        </div>

        </div>
    </div>
</div>
<!--主体部分结束-->

<!-- 底部开始 -->
<div id="footer">
    <div class="message clearfix">
        <div class="logo fl">
            <img src="images/footer_logo.jpg" alt="">
        </div>
        <dl class="fl">
            <dt><a href="">了解若维</a></dt>
            <dd><a href="">关于我们</a></dd>
            <dd><a href="">商务合作</a></dd>
        </dl>
        <dl class="fl">
            <dt><a href="">帮助与支持</a></dt>
            <dd><a href="">反馈建议</a></dd>
            <dd><a href="">联系我们</a></dd>
        </dl>
        <dl class="fl">
            <dt><a href="">联系我们</a></dt>
            <dd><a href="">联系电话：<span>0631-7894-666</span></a></dd>
            <dd><a href="">地址：山东省威海市高新技术开发区仁泰花园8号楼</a></dd>
        </dl>
    </div>
    <div class="copyright">
        <span>2013-2018若维信息 版权所有</span>
        <span>京公网安备110108020217751号</span>
        <span>京ICP备16034860号-1</span>
    </div>
</div>
<!-- 底部结束 -->
</body>
<script>
     function  updateInfo(){
        let flag;
        let phoneNumber = $("#teachPhone").val();
        let direction = $("#teachDirection").val();
        if(direction.equals("教学")){
            flag = 0;
        }else if(direction.equals("就业")){
            flag = 1;
        }else if( direction.equals("管理")){
            flag = 2;
        }
        $.ajax({
            type :"POST",
            url:"/club_teacher/changeTeacherPersonal",
            data:{id:2,file:null,phone:phoneNumber,career:flag},
            success:function(data){
                if(data.data.success){
                    alert(data.data.message);
                }else{
                    alert(data.data.message);
                }
            },
            error:function(){
                alert("修改失败!");
            }
        })
    }
</script>
</html>